﻿using System.Collections.Generic;
using Contacts.Models;
using System.Data.Entity;

namespace Contacts {
  public class Initialize : DropCreateDatabaseIfModelChanges<Contacts.Models.Database> {

    protected override void Seed(Contacts.Models.Database context) {

      context.Contacts.Add(new Contact {
        Firstname = "First1",
        Lastname = "Last1",
        ContactInformations = new List<ContactInformation>
        {
          new ContactInformation { ContactTypeId = 1, ContactId = 1, Information = "(111) 111-1111" },
          new ContactInformation { ContactTypeId = 4, ContactId = 1, Information = "first1.last1@testing.com" }
        }
      });
      context.Contacts.Add(new Contact {
        Firstname = "First2",
        Lastname = "Last2",
        ContactInformations = new List<ContactInformation>
        {
          new ContactInformation { ContactTypeId = 1, ContactId = 2, Information = "(222) 222-2222" },
          new ContactInformation { ContactTypeId = 4, ContactId = 2, Information = "first2.last2@testing.com" }
        }
      });
      context.Contacts.Add(new Contact {
        Firstname = "First3",
        Lastname = "Last3",
        ContactInformations = new List<ContactInformation>
        {
          new ContactInformation { ContactTypeId = 1, ContactId = 3, Information = "(333) 333-3333" },
          new ContactInformation { ContactTypeId = 4, ContactId = 3, Information = "first3.last3@testing.com" }
        }
      });

    }

  }
}